#ifndef HBB_TREE_H
#define HBB_TREE_H

#include <vector>

#include "src/scene/hbb/box.h"
#include "src/scene/material.h"
#include "src/scene/ray.h"
#include "src/scene/nearestInfo.h"

#define WITHOUT_HBB 0

class Object;

//** Essa classe vai conter a arvore interna
class HBBTree{
	public:
		HBBTree(HBBBox * = NULL);
		HBBTree(const std::vector<Object *> &, const unsigned int &);
		virtual ~HBBTree();

		int draw(const unsigned int & = 0) const;
		bool hit(const Ray &, NearestInfo *, Object * = NULL) const;

        #if WITHOUT_HBB
		std::vector<Object*> objetos;
		#endif //WITHOUT_HBB

	protected:
        HBBTree **children; //sempre tem um da direita e outro da esquerda ou o proprio nó para o objeto
        HBBBox *box;
        bool internal;

        virtual Object *getObject() const {return NULL;};

//		virtual bool isInternal() const {return true;};
};

#endif

